#include <iostream>
#include <stdlib.h>
using namespace std;
 
class Test {
public:
    Test() {
        cout << "Test constructing!" << endl;
    }
    ~Test() {
        cout << "Test destructing!" << endl;
    }
};
class Base {
public:
    Base() {
        cout << "Base constructing!" << endl;
    }
    ~Base() {
        cout << "Base destructing!" << endl;
    }
};
 
class Derived : public Base {
public:
    Derived() {
        cout << "Derived constructing!" << endl;
    }
    ~Derived() {
        cout << "Derived destructing!" << endl;
    }
    Test test;
};
 
int main()
{
    Derived* derived = new Derived;
    delete derived;
 
    system("sleep 2");
}
